package com.yikome.config;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ApiResult implements Serializable{
	
	public static final int CODE_SUCCESS = 1 ; 
	public static final int CODE_ERROR_COMMON = 0 ; 
	
	public static final int CODE_ERROR_TOKEN_INVALIDED = -1 ; 
	public static final int CODE_ERROR_NO_ACCESS = -2 ; 
	public static final int CODE_ERROR_TOKEN_MISS = -3 ; 
	
	private static final long serialVersionUID = 2177934880558383341L;

	private int code;

    private String message;
    
    private Object datas;

	public ApiResult(int code) {
		super();
		this.code = code;
	}

	public ApiResult(int code, String message) {
		super();
		this.code = code;
		this.message = message;
	}

	@Override
	public String toString() {
		return "ApiResult [code=" + code + ", message=" + message + ", datas=" + datas + "]";
	}
}